UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kd7aS0WowoFjHSXIusfC5LjiA8GM6IvLPCbR3jrz0oc='
WHERE
key_id = 'bc0ec70b5e2ce70f20b0a41984cd348c29aebcf197a6f9be274140eeab238d66'
AND (
token = 'Kd7aS0WowoFjHSXIusfC5LjiA8GM6IvLPCbR3jrz0oc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)