UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bUvV3RnOtCxWexGvyYw1KuIHwv8+LHTGR2KEZRcFYVw='
WHERE
key_id = 'd3977cdf703e45a23e38f71bf8c835d03b02891f1995f2d6f6caf8b58116a5c4'
AND (
token = 'bUvV3RnOtCxWexGvyYw1KuIHwv8+LHTGR2KEZRcFYVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)