UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79uRkVBvjCh2wOYOSB0xR67t0xvB4KGzlheO7M5MMvQ=' 
WHERE 
  key_id = '261549f75fb185394e2f0b10f17e8d36bf4fefe991636849a9356f5ded3fe81a' 
  AND (
    token = '79uRkVBvjCh2wOYOSB0xR67t0xvB4KGzlheO7M5MMvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026