UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2JQJJWgaUoi6hV4lHQsFqcDjO9/zrtyaunNNQvldnqw='
WHERE
key_id = '0aaa66ec06b7c1a1ba8b4a1dbb6d35986d18768a36bcb5e2fd894a45bfc660ab'
AND (
token = '2JQJJWgaUoi6hV4lHQsFqcDjO9/zrtyaunNNQvldnqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)