UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OmtvZL611PW5J6g1TnxMAj3OdwB+4Wu95LdyKgYsGO4='
WHERE
key_id = '0f09322addfa6bed005425e9a444af2ed05b07847fc4635691b325ea5ef7396c'
AND (
token = 'OmtvZL611PW5J6g1TnxMAj3OdwB+4Wu95LdyKgYsGO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)