UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YhjU3srJ1vd7z3riAmNSmInZyfocH7zC84V9Xh9UfP0=' 
WHERE 
  key_id = 'a6910d2ef21b68755a469e2b5f8242d32f5e0d1ef69a936ddc15cbf508b9016b' 
  AND (
    token = 'YhjU3srJ1vd7z3riAmNSmInZyfocH7zC84V9Xh9UfP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017