UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cK2jGBq6j1jojTujpxfr6oAOGx+EyyoCGSCjZvsRrgI=' 
WHERE 
  key_id = 'c34a9a6016175a520b72de8e941e735cdc07eeacb9bf937e4c484b9e5961bbc6' 
  AND (
    token = 'cK2jGBq6j1jojTujpxfr6oAOGx+EyyoCGSCjZvsRrgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027