UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xlhW0yyE7tSBfF2TNwQM6tSN4W8ZKxfQoLTmN+9bqKc='
WHERE
key_id = '6ddb4f2b09c050cb510dc3ebce85cd4c1240c8a173ec1ebd715ed08abbb3c19a'
AND (
token = 'xlhW0yyE7tSBfF2TNwQM6tSN4W8ZKxfQoLTmN+9bqKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)