UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8F4oNTxCJpMCPKVNvU5BkPPLScO3j7dh7FQ2ZCUkIEc='
WHERE
key_id = '9d1292917282f99a8bc0855b6d9188493047e8d85d4cd9732abc1a7e8435c594'
AND (
token = '8F4oNTxCJpMCPKVNvU5BkPPLScO3j7dh7FQ2ZCUkIEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)