UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kcDVkc/bqR8azYFdm8Apbvg/JHD99aZfL5YsXlYqCrs='
WHERE
key_id = '9b05c222d726f1fb865844b42a4f62d9bd1493c7b7a9aa862350d30af9953a11'
AND (
token = 'kcDVkc/bqR8azYFdm8Apbvg/JHD99aZfL5YsXlYqCrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)