UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oJKKRzY4y1UbIy+DaujOjL0yU02OTTuJ+FEJXnjpyAw=' 
WHERE 
  key_id = 'c5d4a42ca569192b2039c66a3ccc3edc6dc3c2d1e7743cf2d6bdc6cf2386a6b4' 
  AND (
    token = 'oJKKRzY4y1UbIy+DaujOjL0yU02OTTuJ+FEJXnjpyAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032