UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dCMBmkXS3ckEAIPWZPgIRfW0IKhjBA0QnOLGVq6Usf4='
WHERE
key_id = '9eefbc918c0853db2d8200308b8c655d1f1161a0b0ad83cd6351a52a9361c1b3'
AND (
token = 'dCMBmkXS3ckEAIPWZPgIRfW0IKhjBA0QnOLGVq6Usf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)