UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NB4x6js0Pp4lNbKCJny+PAhz8Xz1HbhdTjBq+o+JsmM='
WHERE
key_id = '4c1a9c94deed6c4cc12a26b3e16e691424299c99ddcc01be6e97d8ad4e6667d5'
AND (
token = 'NB4x6js0Pp4lNbKCJny+PAhz8Xz1HbhdTjBq+o+JsmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)