UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fHQcO2V1vMf+JOBEkNETNcHs7RSqL9/f/rhRxX6F5iI='
WHERE
key_id = '33872f5de767a5c207303340567b7fa2a5e52de55500bf7dd79dd29e946a9275'
AND (
token = 'fHQcO2V1vMf+JOBEkNETNcHs7RSqL9/f/rhRxX6F5iI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)