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

Query time 0.00042