UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I/O/PG4uQZeixhIjwLnsNIKPoYO66apJ3lYxuo3R3zU=' 
WHERE 
  key_id = '1eaefe417dc84ab4d0aa337fa16738f502b7d8908a9d7de17b82cbcf9039ba6f' 
  AND (
    token = 'I/O/PG4uQZeixhIjwLnsNIKPoYO66apJ3lYxuo3R3zU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033