UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+qAA8zE/4DAlyZJ5yFg6oZ7GMXvHQJOj4x7i1WX1MI8='
WHERE
key_id = '72fd4165d38ab9da016af6cef7428dda42af7ae9a98706471ef348a0308c6c27'
AND (
token = '+qAA8zE/4DAlyZJ5yFg6oZ7GMXvHQJOj4x7i1WX1MI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)