UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BWlLKpHCVQw+ye7UqIX6KR3+lBWIBsVAeGdhAaQMIIM='
WHERE
key_id = '7ce2ead472d95b7af5cf3162cc97aab97f4859bcf1746c4977952283def96051'
AND (
token = 'BWlLKpHCVQw+ye7UqIX6KR3+lBWIBsVAeGdhAaQMIIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)