UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZfxCkuvWyaU1hWP+cCS22iCDZQIoZDtSudmtZFFRJi4='
WHERE
key_id = 'fbf384b047300b60905b27001992584fc19121e3f1af15b09020725c7255c5c6'
AND (
token = 'ZfxCkuvWyaU1hWP+cCS22iCDZQIoZDtSudmtZFFRJi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)