UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvihN6ebDWb2q5HgcuRo4u4ifd0ARlTpQQasjdl/Mik='
WHERE
key_id = '83b43aa91a1e2870a7357b47b64d3e64e70ffebf0053efc511f3e6ee2dfde9a8'
AND (
token = 'UvihN6ebDWb2q5HgcuRo4u4ifd0ARlTpQQasjdl/Mik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)