UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7rEMt/Ik6sn6csfCep5OSs7/xv1z13MR61Sa7Jhoybk='
WHERE
key_id = '8798e1f577a2e35212dd662e9e7bec8e5afb62ab5c3c608eed4a39d2ccac66dd'
AND (
token = '7rEMt/Ik6sn6csfCep5OSs7/xv1z13MR61Sa7Jhoybk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)