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

Query time 0.00022