UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7GbLKnwYYxS5c4aGJVOblMCZu1ibBQyfT2/j/wdklZw='
WHERE
key_id = '24c1ec2b95e336c3de886dd87a52d546c5dddafbb5adf0011b251941a9db4432'
AND (
token = '7GbLKnwYYxS5c4aGJVOblMCZu1ibBQyfT2/j/wdklZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)