UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uErm2p9zpO/7wJUrf1g1giCGwGcu6VgTn/IoHE7psSw=' 
WHERE 
  key_id = '094b27e0e38f8f75377e817e4ad855bebf6660b2409ba53d90bf0081cd8d2b3d' 
  AND (
    token = 'uErm2p9zpO/7wJUrf1g1giCGwGcu6VgTn/IoHE7psSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028