UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y11v5vr7Y4V41AGL59m6rQoawtvZ4suOj8SS0yqf424='
WHERE
key_id = '2b8a03bed373b29be9972d7ab44bb6e35e234c9517d0d6f0dc5313b6439d04f7'
AND (
token = 'Y11v5vr7Y4V41AGL59m6rQoawtvZ4suOj8SS0yqf424='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)