UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HkcyLS1hDE75eIbs0/+zEEHLH1RjkYnBxeXfeS0rXFY='
WHERE
key_id = '34e2dfcb9d878f107ab6517b50946e2c9090cc49c6ce4668fe42cdf93414a754'
AND (
token = 'HkcyLS1hDE75eIbs0/+zEEHLH1RjkYnBxeXfeS0rXFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)