UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmt75QTvK656D44sr5Bbtw8Xic5tKTHJ/p2q4lOGX/c=' 
WHERE 
  key_id = 'f15fa973266217ed4c4ff805d1c5f60628143e0961e55a1b3ae309ca747cbe74' 
  AND (
    token = 'zmt75QTvK656D44sr5Bbtw8Xic5tKTHJ/p2q4lOGX/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040