UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L9eleLjiQXjwVEgnSvqWwMgFwNd+RsnIDbBgBhaIvPQ=' 
WHERE 
  key_id = '78a0367376434c8ee8de6e04174950c0141a80e889b1d2d1253b539d481b1c32' 
  AND (
    token = 'L9eleLjiQXjwVEgnSvqWwMgFwNd+RsnIDbBgBhaIvPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055