UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hCEXyTD+1SQevEefROVAy4SXluCa0CVweRNVZZTCGv0=' 
WHERE 
  key_id = 'f52e971e8f3152493bff3bea1a948977251d37439d93af21837accd96b7c1e56' 
  AND (
    token = 'hCEXyTD+1SQevEefROVAy4SXluCa0CVweRNVZZTCGv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045