UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'arUS1dD5dTiY4abAVEdgjJbc7A9PIup6nc66rfI5XT0='
WHERE
key_id = '60c5a96597b3b28a35db0dc1eb7cfaf0782fbb16c6aa7cdcd43c19eabc563778'
AND (
token = 'arUS1dD5dTiY4abAVEdgjJbc7A9PIup6nc66rfI5XT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)