UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lK1La1JYfuSNxUeOSxyd7niOwDJ7qfzhsg4dR2i7BhI=' 
WHERE 
  key_id = '342843b9b0e05f273a780bf384921b65221997e672eaf8c78e7e452cbb38858b' 
  AND (
    token = 'lK1La1JYfuSNxUeOSxyd7niOwDJ7qfzhsg4dR2i7BhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029