UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9T4GefPimzV/O8TxD441vUcD24OJ/HYLIjNckWQ3Ntw='
WHERE
key_id = '7339f3c18fe326adf2af8f4d8d89c7d4eca31dd0a55c349943f48026328bc2fd'
AND (
token = '9T4GefPimzV/O8TxD441vUcD24OJ/HYLIjNckWQ3Ntw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)