UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i35GthBbIS6s9f2LhzCKJmjtr/dGFCPRxeQXLQyY0wQ='
WHERE
key_id = '50679a683efbc85ba29300d33c9a9c0b4d56769e90bf8b8020727105b41f55f7'
AND (
token = 'i35GthBbIS6s9f2LhzCKJmjtr/dGFCPRxeQXLQyY0wQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)