UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6C8NHgsNSDjXGdK+SwVid75+/4JLEBi+tpdILJ19Ng4='
WHERE
key_id = 'f8652921b24e623ae9caa1459f8cf473e8238afbe4656e1d22bbdfe12ba00a99'
AND (
token = '6C8NHgsNSDjXGdK+SwVid75+/4JLEBi+tpdILJ19Ng4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)